package com.glls.sbdemo1.controller;

import com.glls.sbdemo1.config.MicroServiceUrl;
import com.glls.sbdemo1.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @date 2023/5/11
 * @desc
 */
@RestController
@RequestMapping("/hello")
public class HelloSb {

    @Autowired
    private User user;


    //读取  配置文件中的配置  赋值给当前属性
    @Value("${oss.key}")
    private String key;

    @Autowired
    private MicroServiceUrl microServiceUrl;


    @RequestMapping("/test1")
    public Map<String,Object> test(){
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("name","zs");

        System.out.println(user);

        System.out.println(key);

        System.out.println(microServiceUrl.getOrderUrl());
        System.out.println(microServiceUrl.getUserUrl());

        System.out.println("777");

        return hashMap;
    }

}
